home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_20_1987_Transactor_Publishing.d64 / read any sector (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  42 lines

  1. 100 rem********************************
  2. 110 rem***     read any sector      ***
  3. 120 rem***     by frank digioia     ***
  4. 130 rem********************************
  5. 140 rem the transactor  vol 8 issue 3
  6. 150 rem********************************
  7. 160 open15,8,15,"i0"
  8. 170 t=1:s=1:x=0:dim a(255)
  9. 180 ts$="m-w"+chr$(6)+chr$(0)+chr$(2)
  10. 190 sj$="m-w"+chr$(0)+chr$(0)+chr$(1)
  11. 200 input"[147]track";t
  12. 210 if t<1 or t>40 then 200
  13. 220 input"sector";s:if s<0 then 220
  14. 230 print#15,ts$;chr$(t)chr$(s)
  15. 240 print#15,sj$;chr$(176):rem do seek
  16. 250 gosub 420:rem await completion
  17. 260 print#15,ts$;chr$(t)chr$(s)
  18. 270 print#15,sj$;chr$(128):rem do read
  19. 280 gosub 420:rem await completion
  20. 290 print#15,"m-r"chr$(0)chr$(3)chr$(255)
  21. 300 print"[147]":fori=0to255:get#15,a$
  22. 310 a(i)=asc(a$+chr$(0)):print a$;:next
  23. 320 print"hit any key for screen codes"
  24. 330 poke198,0:wait198,1:geta$:print"[147]"
  25. 340 fori=0to255:poke1024+i,a(i)
  26. 345 poke55296+i,1:next: rem colour ram
  27. 350 print"hit a key for ascii codes"
  28. 360 poke198,0:wait198,1:geta$:print""
  29. 370 fori=0to255:print a(i);:next
  30. 380 print#15,"i0":close15:end
  31. 390 rem********************************
  32. 400 rem   wait for activity complete
  33. 410 rem********************************
  34. 420 fori=1to3000:next:rem initial delay
  35. 430 print#15,"m-r"chr$(0)chr$(0)
  36. 440 get#15,a$:a=asc(a$+chr$(0))
  37. 450 if a=176 then print"seeking track"
  38. 460 if a=128 then print"reading sector"
  39. 470 x=x+1:if a>127 and x<11 then 420
  40. 480 if a=1 then print"okay":x=0:return
  41. 490 print"error!!!":print#15,"u:":stop
  42.